// pages/processInfo/processInfo.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    person: ['1号', '2号', '3号'],
    personIndex: 0,
    picUrl: '',
    picMessage: '',
    cover: false,
    coverText: '',
  },
  bindPersonChange: function (e) {
    this.setData({
      personIndex: e.detail.value
    })
  },
  fnPicTap: function () {
    let that = this;
    wx.chooseImage({
      count: 3,
      sizeType: ['original', 'compressed'],
      sourceType: ['album', 'camera'],
      success(res) {
        that.setData({
          picMessage: res.tempFilePaths.length,
          picUrl: res.tempFilePaths
        })
      }
    })
  },
  fnBtnTap: function (e) {
    this.setData({
      coverText: e.currentTarget.dataset.data,
      cover: true
    })
    setTimeout(() => {
      this.setData({
        coverText: '',
        cover: false
      });
      wx.navigateBack({
        delta: 1
      });
    }, 2000);
  },
  fnBtn1Tap: function () {
    wx.navigateBack({
      delta: 1
    });
  },
  //图片点击放大
  fnImgTap: function () {
    // wx.previewImage({
    //   current: 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg',
    //   urls: ['http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg', 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg']
    // })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      state: options.state
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})